﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Administrator
{
    public partial class ucJoinReportGroup : UserControl
    {
        private Boolean LoadSetting = false;
        public Int32 tmpReportGroupType = 0;
        
        public ucJoinReportGroup()
        {
            InitializeComponent();
        }

        public void FillSetting(Int32 ReportGroupType)
        {
            if (ReportGroupType < cMain.ReportGroupList.Length)
            {
                tmpReportGroupType = ReportGroupType;
                LoadSetting = true;
                cbReportGroup.Items.Clear();
                for (Int32 i = 0; i < cMain.ReportGroupList.Length; i++)
                    cbReportGroup.Items.Add(cMain.ReportGroupList[i].Caption);
                cbReportGroup.SelectedIndex = tmpReportGroupType - 1;
                LoadSetting = false;
            }
        }
        private void cbReportGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            if ((!LoadSetting) && (cbReportGroup.SelectedIndex >= 0))
                tmpReportGroupType = cbReportGroup.SelectedIndex + 1;            
        }
    }
}
